<template>
    <div id="app">
        <!-- 头部 -->
        <ry-header :seller="seller" />
        <!-- 导航栏 -->
        <ry-nav />
        <!-- 主题 -->
        <keep-alive>
            <router-view v-if="flag" :seller="seller" />
        </keep-alive>
    </div>
</template>

<script>
    import RyHeader from './components/header/Header'
    import RyNav from './components/nav/Nav'

    export default {
        name: 'App',
        components: {
            RyHeader,
            RyNav
        },
        data() {
            return {
                flag: false,
                seller: {}
            }
        },
        created() {
            fetch('/api/seller.json').then(response => response.json()).then(response => {
                this.seller = response;
                this.flag = true;
            })
        }
    }
</script>